<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<?php 
$params = array();
if (isset($this->params['plugin'])) {
	$params['plugin'] = $this->params['plugin'];
}
?>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>[:.QAT - <?php echo $title_for_layout?>.:]</title>
<link href="<?php echo $html->url('/')?>img/favicon.ico" rel="shortcut icon" type="image/x-icon" />

<?php 
// Load CSS
echo $this->Html->css('common', 'stylesheet', array('type' => 'text/css'));
echo $this->Html->css('custom', 'stylesheet', array('type' => 'text/css'));

// Load Javascript
echo $this->Html->script('jquery.lib.min', array('type' => 'text/javascript'));
echo $this->Html->script('common', array('type' => 'text/javascript'));
?>
    
</head>
<body>
	<?php $session->error();?>
	<?php 
	$login_permissions = $session->read('assigned_permissions');
	if (!is_array($login_permissions)) {
		$login_permissions = array();
	}
	?>
    <!-- container -->
    <div id="container">

        <!-- header -->
        <div id="header">
            <h1>
            	<a href="#"><?php __("Công ty QAT");?></a>
            	<div class='flags flag_<?php echo Configure::read('Config.langCode');?>'>&nbsp;</div>
            </h1>
            <h2><?php __("Hệ thống quản trị website")?></h2>
        </div>
        <!-- header.end -->

        <!-- user -->
        <?php echo $this->element('sections/user_utils')?>
        <!-- user.end -->

        <!-- menu -->
        <?php echo $this->element('top_menu/main')?>
        <!-- menu.end -->

        <!-- main -->
        <table id="main" cellpadding="0" cellspacing="0">
            <tr>
                <td id="aside">
                    <div class="accordion">
						<?php if (isset($this->left_menu)):?>
                    	<?php echo $this->element($this->left_menu, $params + array('permissions'	=>	$login_permissions))?>
                    	<?php endif;?>
                    </div>
                    
                    <?php echo $this->element('sections/online_users')?>
                </td>
                <td id="separator">&nbsp;</td>
                <td id="content">
					<?php echo $content_for_layout;?>
                </td>
            </tr>
        </table>
        <!-- main.end -->

        <!-- footer -->
        <div id="footer">
            <p>Bản quyền &copy; 2011 Công ty QAT. Mọi quyền được bảo lưu.</p>
        </div>
        <!-- footer.end -->

    </div>
    <!-- container.end -->
	
	<div id='changeCurrentUserPass' title="<?php __("Thay đổi mật khẩu")?>" class='cake_form'>
		<?php 
			echo $form->create("User", array('url'	=>	array(
					"plugin"		=> "users",
					"controller"	=> 'users', 
					"action"		=> "change_pass"
				),
				"id"	=> "changePassword"
			));
			?>
		<fieldset class="form">
		
		<?php 
		echo $form->input('id', array('type'=>'hidden'));
		echo $form->input('old_password',array( 'label' => __('Mật khẩu cũ:', true), 'type'=>'password'));
		echo $form->input('new_password',array( 'label' => __('Mật khẩu mới:', true), 'type'=>'password'));
		echo $form->input('re_new_password',array( 'label' => __('Nhập lại mật khẩu mới:', true), 'type'=>'password'));
		?>
		<div align='center' class='submit'>
			<input type='submit' name='btnSubmit' value='<?php __("Đổi mật khẩu")?>' class='button'/>
		</div>
		</fieldset>
		<?php 
			echo $form->end(); 	
		?>
	</div>
    <!-- script -->
    <?php echo $this->Html->script('jquery.form', array('type' => 'text/javascript'));?>
    <!-- script.end -->

</body>
</html>
